<%@page import="com.wanmait.cookBook.vo.Userinfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%String path =request.getContextPath();%>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人资料 - 美食天下</title>
<meta name="renderer" content="webkit">
<meta name="keywords" content="">
<meta name="description" content="" />
<link rel="shortcut icon" href="https://static.meishichina.com/v6/img/lib/f.ico"/>
<link rel="apple-touch-icon" href="https://static.meishichina.com/v6/img/lib/wapico.png" />
<link rel="stylesheet" type="text/css" href="https://static.meishichina.com/v6/css/lib/all.css?v1=13">
<link rel="stylesheet" type="text/css" href="https://static.meishichina.com/v6/css/app/center/all.css?v1=2017-08-17">
</head>
<body>

	<!-- 主框架 -->
<div class="w_main clear">

    <div class="mod_left">
        <div class="menu_wrap">
<ul>
<li>
<a class=on href="<%=path%>/front/personal.jsp">用户<br>中心</a>
</li>
<li>
<a  href="<%=path%>/CookServlet">个人<br>菜谱</a>
</li>

<li>
<a   href="<%=path%>/front/upDiary.jsp">日志</a>
</li>
<li>
<a  href="<%=path%>/getAllTasteServlet">发布<br>作品</a>
</li>
<li>
<a  href="javascript:void(0)">账户<br>设置</a>
</li>
</ul>
</div>
    </div>


 <!-- 右侧 -->
<div class="mod_right">

<div id="mod_location">
<div class="mod_location clear">
<div class="left">
<a href="javascript:void(0)" class=on>个人资料</a>
<a href="javascript:void(0)" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a><!-- 中间的空格 -->
<a href="<%=path %>/front/changePass.jsp" >修改密码</a>
</div>
</div>
</div>

<form action="<%=path %>/UserinfoServlet?action=changeMeans" id="J_form"  enctype="multipart/form-data" method="post">

<div class="mr_edit mr_edit_center clear">
<ul>
<%Userinfo loginuser=(Userinfo)session.getAttribute("loginuser"); %>
<li>
<label>头像</label><br>
<img class="imgLoad" src="<%=path %>/front/userImages/<%=loginuser.getUserFace() %>"  width=120 height=120 /><br><input name="loginFace" class="inputS" type="file">

</li>


<li>
<label>性别</label><br>
<input type="hidden" id="things_type1" name="loginSex" >
<div class="things_type1 clear">
<span data-value="男" class="on">&nbsp;&nbsp;男&nbsp;&nbsp;</span>
<span data-value="女" >&nbsp;&nbsp;女&nbsp;&nbsp;</span>

</div>
</li>

<li>
<label>家乡</label><br>
<select  id="J_birthprovince" data-width="100" style="display:none">
<option value=""></option>
</select>

<select  id="J_birthcity" data-width="100" style="display:none">
<option value=""></option>
</select>
</li>

<li>
<label>电子邮箱</label><br>
<input name="loginEmail" class="inputM" type="text" id="J_email" value="">
</li>

<li><label>个人签名</label><br>
<input name="loginWords" class="inputL" type="text" id="J_sign" value="">
</li>
</ul>
<input  value="保存修改" class="btn1" type="submit">
</div>
</form>


		</div><!-- 右侧结束 -->
</div>
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/all.js?v1=20180922"></script>
<script type="text/javascript">
msc.user.init();
$("img.imgLoad").imgLoad();
</script>



<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/msc-tools-region.js"></script>
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/msc-tools-region-data.js"></script>
<script type="text/javascript" src="//static.meishichina.com/v6/js/lib/msc-ui-select.js"></script>
<script type="text/javascript">
new msc.tools.region({
        province: "#J_birthprovince",
        city: "#J_birthcity",
        auto: true
    });
msc.ui.select({
        id: "#J_form select",
        width: function() {
            return this.getAttribute("data-width") || 120;
        },
        defaultValue: true
    });

$(".things_type1 span").click(function(){
var id=$(this).attr("data-value");
$(".things_type1 span").removeClass("on");
$(this).addClass("on");
$("#things_type1").val(id);
}
);


$("#J_form").submit(function(){
if($("#J_birthprovince").val() && $("#J_birthcity").val() === '请选择市'){
msc.ui.dialog.error('家乡地址不完整');
}else if($("#J_email").val() && !/^[0-9a-z_][_.0-9a-z-]{0,31}@([0-9a-z][0-9a-z-]{0,30}\.){1,4}[a-z]{2,4}$/.test($("#J_email").val())){
msc.ui.dialog.error('电子邮箱格式不正确');
$("#J_email").focus();
}else if($("#J_sign").val().length>30){
msc.ui.dialog.error('个人签名最多输入30字符');
$("#J_email").focus();
}else{
msc.ui.dialog.loading();
return true;
}

return false;
});

</script>
<script>
$(function(){
	<%String action=request.getParameter("action");%>
	<%if("succeed".equals(action)){%>
		alert("修改资料成功");
	<%
	}%>
});
</script> </body>
</html>